package cn.edu.lingnan.service;

import cn.edu.lingnan.user.dtos.*;
import cn.edu.lingnan.user.pojos.Exam;
import cn.edu.lingnan.user.pojos.PageBean;
import cn.edu.lingnan.user.vos.ExamPaperDetailVo;
import cn.edu.lingnan.user.vos.ExamScoreVO;

public interface ExamService {

     PageBean<?> getExamList(ListExamDto listExamDto);

     void addExam(Exam exam);

     Integer deleteExam(Integer examId);

     PageBean<?> getExamUser(ListUserExam listUserExam);

     Exam getExamById(Integer examId);

     void updateExam(Exam exam);


     Integer addExamUser(AddExamUserDto addExamUserDto);

     void publishExam(Integer examId);

    Integer getExamIdByPaperId(Integer paperId);

     void updateExamStatus(Integer examId, Integer status);

    Integer joinExam(Integer examId);

    Result<ExamPaperDetailVo> getExamingPaperById(Integer examId);


    void processExamSubmission(SubmitExamDTO submitExamDTO);

    /**
     * 将所有考试已结束但考生状态仍为考试中的记录设置为未交卷
     *
     * @return 受影响的记录数
     */
    int markUnsubmittedExams();


    // 查询用户的考试记录（分页）
    PageBean<ExamScoreVO> getUserExamScores(Integer userId, Integer page, Integer pageSize);

    Integer getExamStatus(Integer examId);


    int countExamByUserId(Integer userId);
}
